package com.huang.A01_case;

/**
 * 目标：
 * 完成购买飞机票案例
 */
public class Demo1 {
    public static void main(String[] args) {
        double price = calculate(1000, 8, "头等舱");
        System.out.println(price);
    }
    public static double calculate(double price, int month, String seat){
        if(month >= 5 && month <= 10){
            //旺季
            switch (seat){
                case "头等舱":
                    price *= 0.9;
                    break;
                case "经济舱":
                    price *= 0.85;
                    break;
            }
        }else {
            //淡季
            switch (seat){
                case "头等舱":
                    price *= 0.7;
                    break;
                case "经济舱":
                    price *= 0.65;
                    break;
            }
        }
        return price;
    }
}